#!/bin/sh
#copy latest netcare-agent
sudo scp -r  $2@$1:$3/netcare/linux_32/netcare-agent /usr/bin/
#write init
sudo sed -i '2i\/usr/bin/netcare-agent &' /etc/rc.d/rc.local

#start netcare
sudo cp /root/Documents/netcare/netcare_version /usr/bin/
sudo /usr/bin/netcare-agent &
sudo sed -i '9i\-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 55555 -j ACCEPT' /etc/sysconfig/iptables
sudo service iptables restart


exit 1

